package com.rtx.wms.customer.k3.base.test;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.List;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;


public class getfield {

	public static void main(String[] args) throws Exception {
		BufferedReader bf = new BufferedReader(new FileReader("C:\\Users\\A\\Desktop\\aa\\customer.txt"));
		StringBuffer sb =new StringBuffer();
		while(bf.ready()) {
			sb.append(bf.readLine());
		}

		JSONObject job = JSON.parseObject(sb.toString(),JSONObject.class);
		JSONObject Result= job.getJSONObject("Result");

		JSONObject NeedReturnData= Result.getJSONObject("NeedReturnData");
		List<JSONObject> list =NeedReturnData.getJSONArray("Entrys").toJavaList(JSONObject.class).get(0).getJSONArray("Fields").toJavaList(JSONObject.class);
		JSONObject tem = new JSONObject();
		StringBuffer sb1 = new StringBuffer();
		for(JSONObject temp:list) {
			String f = temp.getString("FieldName");
			String n = temp.getJSONArray("Name").toJavaList(JSONObject.class).get(0).getString("Value");
			tem.put(f, n);
			sb1.append(f+",");
		}
		System.out.println(sb1.toString());
	}
}
